<nav class="navbar navbar-default">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">管理系统</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">

        <li><a href="{% url 'main:dashboard' %}">仪表板</a></li>
        <li><a href="{% url 'main:home' %}">商品列表</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">商品管理 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="{% url 'main:category' %}">商品分类</a></li>
            <li><a href="{% url 'main:product_images' %}">商品图片</a></li>
          </ul>
        </li>

          <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">用户管理 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="{% url 'main:user_list' %}">用户列表</a></li>
            <li><a href="{% url 'main:address_list' %}">收货地址</a></li>
          </ul>
        </li>

          <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">订单管理 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="{% url 'main:order_list' %}">订单列表</a></li>
          </ul>
        </li>
      </ul>

      <ul class="nav navbar-nav navbar-right">
          {% if request.user.is_authenticated %}
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ request.user }}<span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li><a href="{% url 'user:center' %}">个人中心</a></li>
                <li><a href="{% url 'user:changepwd' %}">修改密码</a></li>
                <li><a href="{% url 'user:changehead' %}">修改头像</a></li>
                <li><a href="{% url 'user:changeinfo' %}">修改信息</a></li>
                <li><a href="{% url 'user:logout' %}">退出</a></li>
              </ul>
            </li>
          {% else %}
            <li><a href="{% url 'user:login' %}">登录</a></li>
              <li><a href="{% url 'user:regist' %}">注册</a></li>
          {% endif %}

      </ul>

    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>